package com.bainaeco.framework.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum IsDelete {
	
	YES(1),
	NO(0);
	
	private Integer value;
	
	private IsDelete(Integer value) {
		this.value = value;
	}
	
	public Integer toIntValue() {
		return this.value;
	}
	
	public static IsDelete toValue(int value) {
		if (YES.value == value) {
			return YES;
		} else if (NO.value == value) {
			return NO;
		} else {
			throw new InvalidArgumentException("Unknown is delete[" + value + "].");
		}
	}
}
